/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cratos.xxgram.platf.base;

import javax.persistence.Transient;

import org.redkale.convert.ConvertDisabled;
import org.redkale.util.Comment;

/**
 * ES 基础参数
 * @author SquRab
 */
public abstract class EsEntity {
    
    @Comment("es 索引")
    @Transient
    private String indexname = "";
    
    @Comment("es 类名")
    @Transient
    private String typename = "";

    @ConvertDisabled
    public String getIndexname() {
        return indexname;
    }

    public EsEntity(String indexname, String typename) {
        this.indexname = indexname;
        this.typename = typename;
    }

    public EsEntity() {
    }

    
    public void setIndexname(String indexname) {
        this.indexname = indexname;
    }

    @ConvertDisabled
    public String getTypename() {
        if (typename.isBlank()) return this.getClass().getName();//默认返class_name
        return typename;
    }

    public void setTypename(String typename) {
        this.typename = typename;
    }
    
    
}
